<template>
	<view class="bg-white">
		<view class="flex flex-wrap padding-sm">
			<view class="good-box radius shadow-warp"
				v-for="(good, gin) in list"
				:key="gin"
				:style="{
					width: `calc(${100 / column}% - ${gutter}rpx)`,
					margin: `0 ${gutter / 2}rpx ${gutter}rpx`
				}"
			>
				<spu-preview :spu="good" @imgTap="onGoToSpu" ></spu-preview>
			</view>
		</view>
		<uni-load-more></uni-load-more>
	</view>
</template>

<script>
import spuPreview from '@/components/box/ViewScenario.vue'
import uniLoadMore from '@/components/basics/uni-load-more/uni-load-more.vue';
export default {
	components: {
		spuPreview,
		uniLoadMore
	},
	props:{
		column: {
			type: Number,
			default: 2
		},
		gutter: {
			type: Number,
			default: 30
		},
		list: {
			type: Array,
			default: () => []
		}
	},
	methods: {
		onGoToSpu(event) {
			const pid = event.currentTarget.dataset.pid
			this.$jumpPages("spuDetail", {
				pid
			})
		},
	}
}
</script>

